package com.woniuxy.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.woniuxy.dao.RoleDao;
import com.woniuxy.entity.Perm;
import com.woniuxy.entity.Role;
import com.woniuxy.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleDao roleDao;

    @Override
    public List<Role> findAll() {
        return roleDao.findAll();
    }

    @Override
    public List<Perm> findPermByRoleId(String json) {
        System.out.println(json);
        Role role = new Role();
        role.setName(json);
        return roleDao.findPermByRoleId(role);
    }
}
